<?php
/**
 * Created by 张彪.
 * User: 小马出行
 * Date: 2017/10/31
 * Time: 17:44
 */
namespace app\api\logic;

use app\api\model\CarInfoModel;
use app\api\model\DriverModel;
use app\api\model\InformModel;

use think\Model;

class AuthLogic extends Model
{

    /*
     * 获取通知信息
     * @param $p
     * @param $map
     * @param $limit
     * @param $field
     * @param $order
     * @return false|\PDOStatement|string|\think\Collection
     * */
    public function getInform($p,$map=array(),$limit=2,$field='*',$order = 'id desc')
    {
        $informModel = new InformModel();
        return $informModel->getInformList($p,$map,$limit,$field,$order);
    }

    /**
     * 保存车辆信息
     *@param $data
     *@return false|\PDOStatement|string|\think\Collection
     * */
    public function createCarInfo($data)
    {
        $carInfo = new CarInfoModel();
        return $carInfo->addCarInfo($data);
    }

    /*
     * 通过参数查找汽车信息
     * $param array $map
     * $param $string
     * @return false|\PDOStatement|string|\think\Collection
     * */
    public function getCarInfo($map=array(),$string='*')
    {
        $carInfo = new CarInfoModel();
        return $carInfo->getCarInfo($map,$string);
    }

    /*
     * 更新认证汽车信息
     * $param array $map
     * $param $data
     * */
    public function updateCar($map=array(),$data)
    {
        $carInfo = new CarInfoModel();
        return $carInfo->updateCarInfo($map,$data);
    }
}